package com.rui.shangXueTang.graph;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : Test
 * @createTime : [2022/2/19 14:09]
 * @description : [描述该类的功能]
 */

public class Test {
    public static void main(String[] args) {
        String[] vertex = {"A", "B", "C", "D", "E"};

        Graph graph = new Graph(5);

        for(int i = 0; i < vertex.length; i++){
            graph.insertVertex(vertex[i]);
        }

        graph.insertEdges(0,1,1);
        graph.insertEdges(0,2,1);
        graph.insertEdges(1,2,1);
        graph.insertEdges(1,3,1);
        graph.insertEdges(1,4,1);

        graph.showList();

//        graph.DFS();
        graph.BFS();
    }
}
